package com.wuzuqing.android.eightdiagrams;

import android.app.Application;
import android.content.Context;

import com.tencent.mmkv.MMKV;
import com.wuzuqing.android.eightdiagrams.hook.testHookers.HookInit;
import com.wuzuqing.android.eightdiagrams.utils.AndroidInitHelper;
import com.wuzuqing.android.eightdiagrams.utils.DataUtils;

/**
 * 作者：士元
 * 时间：2019/8/9 14:13
 * 邮箱：wuzuqing@linghit.com
 * 说明：
 */
public class App extends Application {
    private static Context sContext;

    @Override
    public void onCreate() {
        super.onCreate();
        sContext = this.getApplicationContext();
        HookInit.onCreate(this);
        String rootDir = MMKV.initialize(this);
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    DataUtils.setInputStream(new AndroidInitHelper());
                    DataUtils.init();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }).start();
//        Looper.getMainLooper().setMessageLogging(new Printer() {
//            @Override
//            public void println(String x) {
//                Log.e("MessageLogging >>>", x);
//            }
//        });
    }

    public static Context getContext() {
        return sContext;
    }
}
